import Vue from 'vue'
import Index from './index.vue'

const IndexBox = Vue.extend(Index)
Index.install = function (data) {
  let instance = new IndexBox({
    data
  }).$mount()
  
  document.body.appendChild(instance.$el)

  Vue.nextTick(() => {
    instance.openModify = true
  })
  return instance.showMsgBox().then(val => {
    return Promise.resolve(val);
  }).catch(err => {
    return Promise.reject(err);
  });
}

// export default Index
Vue.prototype.$model = Index.install;